<%@ page import="com.liu.lab03.pojo.Music" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: MyUser
  Date: 2025/3/13
  Time: 17:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title>音乐管理系统</title>
<style type="text/css">
    table,th{
        border-spacing: 0em;
        margin-left: 1px;
        border: 1px solid #220808;
        border-collapse: collapse;
    }/*设置表格最外层边框实线*/
    th{
        color: white;
        background-color: rgba(38, 45, 59, 0.767);
    }
    td{
        border: 1px dashed;
    }/*设置单元格边框纵向虚线*/
    tr{
        vertical-align: top;
        border: 1px dashed;
    }/*设置单元格边框横向虚线*/
</style>
</head>
<body>
<!--输入关键词，点击提交按钮，跳转到ShowAllMusicsServlet文件-->
<form action="showAllMusics" method="post">
    按歌名查找：<input type="text" name="key"/>
    <input type="submit" value="搜索"/>
</form>
&nbsp;
<h1>哈哈哈</h1>
<a href="addMusic.jsp">添加音乐</a>
<c:out value="<h1>哈哈哈</h1>" escapeXml="false"/>

<c:if test="${allMusics.size()>0}">
    <c:out value="<table width='50%' style='border-spacing: 0em;margin-left: 1px;border: 1px solid #220808;border-collapse: collapse;'>" escapeXml="false"/>
    <c:out value="<tr><th>id</th><th>歌名</th><th>演唱者</th><th>排名</th><th>分类</th><th>编辑</th></tr>" escapeXml="false"/>
    <c:forEach items="${allMusics}" var="m" varStatus="s">
        <c:out value="<tr> <td> ${m.getId()}<td>"/>
        <c:out value="<tr> <td> ${m.getMusicname()}<td>"/>
        <c:out value="<tr> <td> ${m.getSinger()}<td>"/>
        <c:out value="<tr> <td> ${m.getRanking()}<td>"/>
        <c:out value="<tr> <td> ${m.getCategory_id()}<td>"/>
        <c:out value="<a href='findMusicById?id=${m.getId()}>修改</a>"/>
        <c:out value="<a href='deleteMusic?id=${m.getId()}>删除</a>"/>
    </c:forEach>
</c:if>
</body>
</html>
